class MatchingFileCounter
  def initialize(file_pattern)
    @file_pattern = file_pattern
  end

  def count_files(directory)
  	count = 0
  	
    directory.files { |file|
	  count = count + 1 if @file_pattern.matches(file)
    }

    count
  end
end
